Skip to content

feat(modules/claude-code): make the module ready for Coder Tasks #160

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jul 1, 2025

Conversation

hugodutka
Copy link
Contributor

@hugodutka hugodutka commented Jun 24, 2025

Related to coder/internal#700

This PR:

  • makes AgentAPI a required dependency of the module. It's now used:
    • to improve task reporting (by exporting CODER_MCP_AI_AGENTAPI_URL before running coder exp mcp configure claude-code)
    • to add a web chat interface to Claude (using the Claude Code Web workspace app)
  • removes support for tmux and screen since we don't need them if we have AgentAPI
  • makes the Claude Code CLI workspace app optional and disabled by default - a new experiment_cli_app module variable controls its presence
  • makes the module spawn the coder_ai_task resource, which makes the module compatible with the new Coder Tasks feature
  • makes Claude Code remember the conversation between workspace restarts using the --continue flag. Previously the module's implementation was a bit bugged

Note: the filebrowser tests stopped passing because of an upstream update in the filebrowser project around required password length. I confirmed they are not related to this PR's changes.

@hugodutka hugodutka force-pushed the hugodutka/cc-agentapi-aitask branch 14 times, most recently from cb31cbf to 33489fc Compare June 24, 2025 14:09
@hugodutka hugodutka force-pushed the hugodutka/cc-agentapi-aitask branch from 33489fc to 6c3c2f0 Compare June 24, 2025 17:59
bpmct and others added 3 commits June 25, 2025 17:27
this is a hack for a demo... preinstall and postinstall script will increase/decrease this time and I aim to find a better way to do this in the feature
@hugodutka hugodutka force-pushed the hugodutka/cc-agentapi-aitask branch 11 times, most recently from 4d634bf to 88f4ec4 Compare June 30, 2025 12:31
@hugodutka hugodutka marked this pull request as ready for review June 30, 2025 12:33
@hugodutka hugodutka requested review from matifali and bpmct June 30, 2025 12:34
@hugodutka hugodutka changed the title feat(modules/claude-code): implement AI task support feat(modules/claude-code): make the module ready for Coder Tasks Jun 30, 2025
@hugodutka hugodutka force-pushed the hugodutka/cc-agentapi-aitask branch from 88f4ec4 to 64e7103 Compare June 30, 2025 12:52
@matifali matifali added the version:major Add to PRs requiring a major version upgrade label Jun 30, 2025
Copy link

❌ Version Bump Validation Failed

Bump Type: major

Module versions need to be updated but haven't been bumped yet.

Required Actions:

  1. Run the version bump script locally: ./.github/scripts/version-bump.sh major
  2. Commit the changes: git add . && git commit -m "chore: bump module versions (major)"
  3. Push the changes: git push

Script Output:

🔍 Detecting modified modules...
Found modules:
registry/coder/modules/claude-code

📦 Processing: coder/claude-code
Found git tag: release/coder/claude-code/v1.4.0 (v1.4.0)
Current version: 1.4.0
New version: 2.0.0
Updating version references for coder/claude-code in registry/coder/modules/claude-code/README.md

🔧 Running formatter to ensure consistent formatting...

📋 Summary:
Bump Type: major

Modules Updated:

- coder/claude-code: v1.4.0 → v2.0.0

READMEs Updated:

- coder/claude-code

✅ Version bump completed successfully!
📝 README files have been updated with new versions.

Next steps:
1. Review the changes: git diff
2. Commit the changes: git add . && git commit -m 'chore: bump module versions (major)'
3. Push the changes: git push

Please update the module versions and push the changes to continue.

@matifali matifali requested a review from DevelopmentCats June 30, 2025 13:03
@hugodutka hugodutka force-pushed the hugodutka/cc-agentapi-aitask branch 2 times, most recently from 73fc656 to eae5cb5 Compare June 30, 2025 13:42
@hugodutka hugodutka force-pushed the hugodutka/cc-agentapi-aitask branch from eae5cb5 to d7639fb Compare June 30, 2025 14:00
Copy link
Contributor

@DevelopmentCats DevelopmentCats left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to pull this branch and test this out because I have been seeing all of the agentapi stuff and I am very interested to see how it runs.

@@ -176,9 +171,58 @@ resource "coder_script" "claude_code" {
npm install -g @anthropic-ai/claude-code@${var.claude_code_version}
fi
if ! command_exists node; then
echo "Error: Node.js is not installed. Please install Node.js manually."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have noticed that sometimes it is better to make an attempt to install node if it is not installed before the claude-code module starts rolling during workspace start.

This might just be something that only I have experienced, but if you dont do this it will make claude code fail to start almost every time unless you have node available in your workspace before the claude code module runs its script. ( Even adding the node module to your template, does not resolve this unless somehow the node module installs first in the order which it never does for me.)

@hugodutka hugodutka merged commit 58faf32 into main Jul 1, 2025
3 of 4 checks passed
@hugodutka hugodutka deleted the hugodutka/cc-agentapi-aitask branch July 1, 2025 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
version:major Add to PRs requiring a major version upgrade
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants